{include file='public/meta'}
<title>编辑委托</title>
{css href='/static/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css'}
</head>
<style type="text/css">
  .row{margin-right:40px;}
</style>
<body>
<link href="/static/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="cl pd-20">
	<form action="" method="post" class="form form-horizontal" id="form-article-add" enctype="multipart/form-data">
    <input type="hidden" name="oid" value="{$oid}">
    <!-- 业主 -->
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>业主：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" placeholder="输入管理员姓名" name="oname" value="{$data.oname}" disabled required>
			</div>
		</div>
    <!-- 区域 -->
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>区域：</label>
        <select name="area" class="select" style="height:35px;width:282px;margin-left:15px">
          <option value="">请选择区/县</option>
          {volist name="data_area" id="vo"}
          <option value="{$vo.id}" {eq name="$vo['id']" value="$data.area"}selected{/eq}>{$vo.name}</option>
          {/volist}
        </select>
    </div>
     <!-- 小区 -->
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>小区：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input type="text" name="vill" placeholder="输入小区" class="input-text" value="{$data.vill}" required>
      </div>
    </div>
     <!-- 地址 -->
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>地址：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input type="text" name="addr" placeholder="输入地址" class="input-text" value="{$data.addr}" required>
      </div>
    </div>
     <!-- 月租 -->
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>月租：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input type="text" name="price" placeholder="输入月租" value="{$data.price}" class="input-text" required number>
      </div>
    </div>
    <!-- 整租/合租 -->
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>整租/合租：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input type="text" name="state" placeholder="输入整租/合租" class="input-text" value="{$data.state}" required>
      </div>
    </div>
    <!-- 朝向 -->
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>朝向：</label>
      <div class="formControls col-xs-8 col-sm-9">
        <input type="text" name="face" placeholder="朝东/朝西/朝南/朝北" value="{$data.face}" class="input-text" required>
      </div>
    </div>
    <!-- 房屋特征 -->
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>房屋特征：</label>
      <div class="formControls col-xs-8 col-sm-9 skin-minimal">
        {volist name="characters" id="vo"}
        <div class="check-box">
            <input name="character[]" type="checkbox" {in name="$vo.id" value="$data.character"}checked{/in} id="id-{$vo.id}" value="{$vo.id}" required>
            <label>{$vo.info}</label>
        </div>
        {/volist}
      </div>
    </div>
    <!-- 房屋配置 -->
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>房屋配置：</label>
      <div class="formControls col-xs-8 col-sm-9 skin-minimal">
        {volist name="inis" id="va"}
        <div class="check-box">
            <input name="ini[]" type="checkbox" {in name="$va.id" value="$data.ini"}checked{/in} id="id-{$va.id}" value="{$va.id}" required>
            <label>{$va.info}</label>
        </div>
        {/volist}
      </div>
    </div>
    <!-- 房屋描述 -->
      <div class="row cl">
        <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>房屋描述：</label>
        <div class="formControls col-xs-8 col-sm-9">
          <input type="text" name="des1" placeholder="说点什么..." class="input-text" value="{$data.des1}" required>
        </div>
      </div>
      <!-- 小区/周边 -->
      <div class="row cl">
        <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>小区/周边：</label>
        <div class="formControls col-xs-8 col-sm-9">
          <input type="text" name="des2" placeholder="说点什么..." class="input-text" value="{$data.des2}" required>
        </div>
      </div>
    <!-- 缩略图 -->
		<div class="row cl">
          <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>房屋展图：</label>
          <div class="formControls col-xs-8 col-sm-9">
              <div class="uploader-thum-container">
                  <input type="file" name="thumb[]" class="input-text" multiple>
              </div>
          </div>
      </div>
    <!-- 审核通过 -->
    <div class="row cl">
      <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>审核通过：</label>
      <div class="formControls col-xs-8 col-sm-9 skin-minimal">
        <div class="check-box">
            <input name="checker" type="checkbox" value="审核通过">
            <label>审核通过</label>
        </div>
      </div>
    </div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button class="btn btn-primary radius" id="submit" type="submit"><i class="Hui-iconfont">&#xe632;</i> 修改</button>
			</div>
		</div>
	</form>
</div>
{include file='public/footer'}
  <script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
  <script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
  <script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/messages_zh.js"></script> 
  <script type="text/javascript" src="/static/lib/webuploader/0.1.5/webuploader.min.js"></script> 
  <script type="text/javascript" src="/static/lib/ueditor/1.4.3/ueditor.config.js"></script>
  <script type="text/javascript" src="/static/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
  <script type="text/javascript" src="/static/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>

<script type="text/javascript">
  $().ready(function(){
  	$('form').validate({
      rules:{
        
      },
  		messages:{
        
      },
  		submitHandler:function(form){
  			$(form).ajaxSubmit({
  				type:'post',
  				url:'{:url('admin/owner/do_edit')}',
  				dataType:'text',
  				success:function(res){
            res = eval('('+res+')');
            console.log(res.msg);
            if(res.msg == '成功'){
              layer.msg('修改成功!',{icon:1,time:2000},function(){
                var index = parent.layer.getFrameIndex(window.name);
    parent.layer.close(index);  
              });
              
            }else{
              layer.msg(res.msg+'!',{icon:1,time:2000});
            }
            // layer_close();
  				}
  			})
  		}
  	});
  })

  $(function(){
  	$('.skin-minimal input').iCheck({
  		checkboxClass: 'icheckbox-blue',
  		radioClass: 'iradio-blue',
  		increaseArea: '20%'
  	});
  });

</script>
</body>
</html>